Occurs when a user resizes a column of a DataGrid control.
Syntax
Private Sub object_ColResize ([ index As Integer,] colindex As Integer, cancel As Integer)
The ColResize event syntax has these parts:
Part | Description |
object | An object expression that evaluates to an object in the Applies To list. |
index | An integer that identifies a control if it is in a control array. |
colindex | An integer that identifies the column. |
cancel | A Boolean expression that determines whether a column is resized, as described in Settings. |
Settings
The settings for cancel are:
Setting | Description |
True | Cancels the change, restores column to its original width. |
False | (Default) Continues with width change. |
Remarks
When the user resizes a column, the ColResize event is triggered. Your event procedure can accept the change, alter the degree of change, or cancel the change completely.
If you set the cancel argument to True, the column width is restored. To alter the degree of change, set the Width property of the Column object to the desired value.
Executing the Refresh method within the procedure causes the control to be repainted even if the cancel argument is True.